package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 优惠券适用商品关联表
 * </p>
 *
 * @author whale
 * @since 2025-05-06
 */
@TableName("tb_coupon_product_relation")
public class CouponProductRelation extends Model<CouponProductRelation> {

    private static final long serialVersionUID = 1L;

    /**
     * 关联唯一标识
     */
    @TableId("relation_id")
    private Long relationId;
    /**
     * 模板id
     */
    @TableField("template_id")
    private Long templateId;
    /**
     * 商品id
     */
    @TableField("product_id")
    private Long productId;
    /**
     * 状态 是否有效（0-有效，1-无效）
     */
    private Integer status;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public CouponProductRelation() {
        this.relationId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getRelationId() {
        return relationId;
    }

    public void setRelationId(Long relationId) {
        this.relationId = relationId;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "CouponProductRelation{" +
        ", relationId=" + relationId +
        ", templateId=" + templateId +
        ", productId=" + productId +
        ", status=" + status +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
